<?php
	$uname=$_REQUEST['name'];
	$mes=$_REQUEST['msc'];
	$sex=$_REQUEST['sex'];
	$img=$_REQUEST['imgurl'];
	
	require 'db_contact.php';
	$sql="insert into tb_emp (姓名,所属部门,头像,出生日期)
		values('$uname','$sex','$img','$mes')
	";
	
	$rs=$db->query($sql);//当$rs为添加的记录数
	
	if ($rs==1)
	{
		   header("Location:main.php");
	}
	else
	{
		   echo "<script>";
		   echo "alert('留言失败');";
		   echo "window.location.href='main.php';";
		   echo "</script>";
	}
	